<template>
    <div>
        <table>
            <tr>
                <td>等级名称</td>
                <td>
                    <input type="text" v-model="data.djmc">
                </td>
            </tr>
            <tr>
                <td>等级状态</td>
                <td>
                    <input type="text" v-model="data.djzt">
                </td>
            </tr>
            <tr>
                <td>启用/禁</td>
                <td>
                    <input type="text" v-model="data.qy">
                </td>
            </tr>
            <tr>
                <td>创建时间</td>
                <td>
                    <input type="date" v-model="data.cjsj">
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="button" value="添加" @click="add">
                </td>
            </tr>
        </table>

    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref } from 'vue';

const data=ref({
    "id": 0,
  "djmc": "string",
  "djzt": "string",
  "qy": true,
  "cjsj": "2025-03-23T11:53:21.769Z"
})

const add=()=>{
    axios.post("https://localhost:7261/api/we/add",data.value).then(res=>{
        if(res.data>0){
            alert("添加成功")
            location.href="/xs"
        }else{
            alert("添加失败")
        }
    })
}
 
</script>

<style scoped>

</style>